<template>
  <div>
    <span v-for="(item, index) in arr" :key="index">
      <input type="checkbox" v-model="arr1" :value="item" />{{ item }}</span
    >
    <hr />
    累计的合为{{ all }}
  </div>
</template>

<script>
export default {
  data() {
    return {
      arr: [9, 15, 19, 25, 29, 31, 48, 57, 62, 79, 87],
      arr1: [],
    };
  },
  computed: {
    all() {
      return this.arr1.reduce((sum, item) => item + sum, 0);
    },
  },
};
</script>

<style scoped></style>
